﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ComunesMGI.DataTypes;

namespace ComunesMGI.Controles
{
    class TablaCamposCampoBoolean : TablaCamposCampo
    {
        public TablaCamposCampoBoolean(DataCampo dc)
            : base(dc)
        {
        }
        protected override Control crearControl(ComunesMGI.DataTypes.DataCampo dc)
        {
            CheckBox  campo = new CheckBox();
            if (!string.IsNullOrEmpty(dc.Valor))
            {
                campo.Checked = bool.Parse(dc.Valor);
            }
            return campo;
        }

        protected override string obtenerValorCampo()
        {
            return ((CheckBox)_campo).Checked.ToString();
        }

        protected override Enum.CampoSharepoint obtenerTipoCampo()
        {
            return ComunesMGI.Enum.CampoSharepoint.Boolean;
        }

        protected override List<string> obtenerOpcionesCampo()
        {
            return null;
        }

        protected override void validar(object sender, System.ComponentModel.CancelEventArgs e)
        {
            // no aplica
        }
    }
}
